<?php
namespace app\api\controller\foodcash\shop;

use app\api\controller\foodcash\Controller;
use app\api\model\Device as DeviceModel;

/**
 * 云设备控制器
 */
class Device extends Controller
{

	/**
     * 获取设备
     */
    public function detail($dev_type)
    {
		$detail = DeviceModel::where(['dev_type' => $dev_type ,'shop_id' => $this->shop_id])->find();
		return $this->renderSuccess(compact('detail'));
    }

    /**
     * 叫号
     */
    public function spk($row_no)
    {
		if(DeviceModel::push($this->shop_id,'rows',$row_no)){
			return $this->renderMsg('叫号成功');
		}
		return $this->renderError('叫号失败');
    }
}
